home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The CDPD Public Domain Collection for CDTV 4
/
CDPD_IV.bin
/
e
/
mailinglists
/
amigae.0793july.archive
/
000049_crash!axion.bt.…uk!D.Higginson_Thu, 22 Jul 93 07:42:09 PST.msg
< prev
next >
Wrap
Internet Message Format
|
1994-05-26
|
5KB
Received: by bkhouse.cts.com (V1.16/Amiga)
id AA00000; Thu, 22 Jul 93 07:42:09 PST
Received: from zaphod.axion.bt.co.uk by crash.cts.com with smtp
(Smail3.1.28.1 #15) id m0oJ0lM-00002KC; Thu, 22 Jul 93 06:32 PDT
Received: from elephant.axion.bt.co.uk by zaphod.axion.bt.co.uk with SMTP (PP); Thu, 22 Jul 1993 14:32:06 +0100
Message-Id: <m0oJ0lM-00002KC@crash.cts.com>
Date: Thu, 22 Jul 93 14:32:00 BST
From: D.Higginson@axion.bt.co.uk
To: amigae@bkhouse.cts.com
Cc: D.Higginson@axion.bt.co.uk
Subject: HAM8 mode
A few people have mailed me wishing information about HAM8
mode, so here goes:
(Please feel free to correct me if I say anything that is
untrue, because my Amiga is currently about 230 miles away
-I'm working away from home.)
HAM mode is available in 2 forms - the original HAM mode
(HAM6) and the AGA HAM mode (HAM8). Of course you will
need the AGA chips to use HAM8 (A1200/A4000), but HAM6 is
available on all Amigas.
The number in the name indicates how many planes are used
to make the image - HAM 6 uses 6 planes. If you don't
understand this, what it basically means is that every
pixel can have a value from 0 to 63. HAM 8 uses 8 planes
which means there are 256 possible values for each pixel.
Whichever HAM mode you use, the theory is essentially the
same. One quarter of these values signify a colour in the
same way as other screen modes. So, colours 0-15 in HAM6
are mapped using a palette (like in DPaint). In this way,
HAM6 behaves like a 16 colour screen and HAM8 like a 64
colour screen.
The difference lies in the way the other colours are used.
I will explain this using HAM6, and then show you how to
adapt it for HAM8.
Colours 16-31 (the second 16 colours) tell the display
chips to modify the amount of BLUE in the colour. The
colour is HELD from the pixel immediately to the left and
the MODIFIED (Hold And Modify). For example, suppose you
have a pixel with value 0, which happens to be black (for
argument's sake). To the right of this is a pixel with
value 24. This tells the system to modify the blue
component. The amount of blue is calculated by subtracting
16. So, this pixel would have colour $008, or medium blue.
Colours 32-47 modify the RED component (if I remember
correctly), and colours 48-63 modify the GREEN component.
These work in the same way, e.g. 32 equals no red, 47
equals maximum red, 48 equals no green, 63 equals maximum
green.
It is possible for this to continue across the screen by
modifying each colour component separately. If at any time
a pixel has a value between 0 and 15, the process begins
again, with the colour for that pixel being taken from the
palette.
Here is an example. Assume that colour 0 is black ($000),
colour 1 is white ($FFF) and colour 2 is grey ($777) - if
you want to now how to set these it can be done using the
LoadRGB4() Intuition routine - see the example E sources
for ... er ... examples.
-----------------------------------------------------
Step (for ref.) A B C D E F G
X,Y 0,0 1,0 2,0 3,0 4,0 5,0 6,0
Pixel value (dec) 00 01 22 02 47 57 21
Colour (hex) $000 $FFF $FF6 $777 $F77 $F97 $F95
-----------------------------------------------------
Colour values here are given as hex value in the standard
Amiga form $RGB. Now I'll explain each step :
A: A vlaue of 0 means the pixel gets its colour from the
palette, which as mentioned previously means that in this
case the pixel turns out to be black.
B: The same here, a value of 1 is between 0 and 15.
C: Here the value is between 16 and 31, so the blue
component is modified. 22 is the 6th number in the range
(counting from 0), so the blue component is changed to 6.
Hence $FFF becomes $FF6.
D: A value between 0 and 15 again means that the colour
comes from the palette, which happens to make the pixel
grey ($777) in this case.
E: 47 is between 32 and 47, so this time the red component
is changed to $F, so $777 becomes $F77.
F: The green component is changed by the number 57. It
does not matter that the previous colour ($F77) is already
modified, changes happen to that colour. $F77 becomes $F97
since 57 is the 9th number between 48 and 63.
G: This shows the blue component again being modified.
This time the colour $F95 did not even have one of its
colour components defined by the palette. In other words,
this colour would still be $F95 even if the original
colour from the palette was changed.